<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
    <ul>
        <% for(var i=0;i<data.length;i++){ %>
            <li><%= data[i].name %></li>
        <%}%>
    </ul>
    <script>
        fetch("/postData",{
            method:'post',
            body:"name=zhangsan&age=20",
            headers:{
                "Content-Type":"application/x-www-form-urlencoded"
            }
            // body:JSON.stringify({name:"zhangsan",age:20}),
            // headers:{
            //     "Content-Type":"application/json"
            // }

        }).then(res=>res.json())
        .then(res=>{
            console.log(res);
        })
    </script>
</body>
</html>